import { createStore, applyMiddleware } from "redux"
import reduxLogger from "redux-logger"
import reduxThunk from "redux-thunk"
import reduxPromise from "redux-promise"
import reducer from "./reducer"

let middleware = [reduxPromise, reduxThunk];
if (process.env.NODE_ENV === "development") {
    middleware.push(reduxLogger)
}

export default createStore(reducer, applyMiddleware(...middleware))